<script setup>

    var cityList = ["北京","上海","深圳","西安","张家口"];
    
    var userInfo = {"userName":"张三","age":20,"sex":"男","address":"北京"};

</script>
<template>
    <ul>
    <li v-for="(cityList, index) in cityList" :key="cityList.id"> 名称: {{ cityList }} </li>
    </ul>
    <div v-for="v in userInfo">{{v}}</div>
    <hr/>
    <!--列表渲染：打印 JSON 键和值-->
    <div v-for="(v,k) in userInfo">{{k}}-{{v}}</div>
    <hr/>
    <!--列表渲染：打印 JSON 下标、键、值-->
    <div v-for="(v,k,i) in userInfo">{{i}}-{{k}}-{{v}}</div>
</template>